package com.ljw.community.entity;

public class TopicConsts {

    public static final String NO_UPLOAD_IMG = "/images/index/logo.png";

    public static final Double AREA_RANGE = 5.0;

    //是否为SVIP，权限是否展示
    public static final String YES = "YES";
    public static final String NO = "NO";

    public static final String WINDOW_UPLOAD_PATH = "F:\\Workspaces\\community\\src\\main\\resources\\static\\";
    public static final String LINUX_UPLOAD_PATH = "/";
    public static final String LINUX_CONFIG_UPLOAD_PATH = "file:F:\\upload\\";
    public static final String WINDOW_CONFIG_UPLOAD_PATH = "file:/upload/";

    public static String getConfigUploadPath() {
        String realPath = TopicConsts.LINUX_CONFIG_UPLOAD_PATH;
        String systemType = System.getProperty("os.name");  //获取系统的类别
        if (systemType.toLowerCase().contains("windows")) { //若为windows系统
            realPath = TopicConsts.WINDOW_CONFIG_UPLOAD_PATH;
        }
        return realPath;
    }


    public static String getUploadPath() {
        String realPath = TopicConsts.LINUX_UPLOAD_PATH;
        String systemType = System.getProperty("os.name");  //获取系统的类别
        if (systemType.toLowerCase().contains("windows")) { //若为windows系统
            realPath = TopicConsts.WINDOW_UPLOAD_PATH;
        }
        return realPath;
    }
}
